bool isValid(char *s)
{
    int a=0,aa=strlen(s);
    if (aa%2!==0)
    {
        return false;
    }
    else if(aa==0)return true;
    //定义存储结构
    typedef struct{
    char data[aa];
    int top;
    }stack;
    //初始化栈
    stack * S;  
    S=(stack*)malloc(sizeof(stack));
    S->top=-1;
    while (a<aa)
    {
        if(s[a]=='['||s[a]=='('||s[a]=='{')
        {
            S->top++;
            S->data[S->top]=s[a];
        }
        else if ((kh->top>=0)&&((s[a]==')'&&kh->data[kh->top]=='(')||(s[a]==']'&&kh->data[kh->top]=='[')||(s[a]=='}'&&kh->data[kh->top]=='{')))
        {
            S->top--;
        }
        else return false;
        a++;
    }
    if(a==aa&&kh->top==-1)return true;
    free(S);
    return 0;
}

